(finder-find-library): New function.
authorRichard M. Stallman <rms@gnu.org>
Sun, 13 Jun 1993 01:36:48 +0000 (01:36 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 13 Jun 1993 01:36:48 +0000 (01:36 +0000)
(finder-commentary): Use it.

lisp/finder.el

index 41e67723dde07dfb1490e096d262790a9661c1d3..44df466d7c69c9d7feb42a8b55c31546f81b567e 100644 (file)
@@ -187,9 +187,23 @@ arguments compiles from `load-path'."
     (shrink-window-if-larger-than-buffer)
     (finder-summary)))
 
+;; Search for a file named FILE the same way `load' would search.
+(defun finder-find-library (file)
+  (if (file-name-absolute-p file)
+      file
+    (let ((dirs load-path)
+         found)
+      (while (and dirs (not found))
+       (if (file-exists-p (expand-file-name (concat file ".el") (car dirs)))
+           (setq found (expand-file-name file (car dirs)))
+         (if (file-exists-p (expand-file-name file (car dirs)))
+             (setq found (expand-file-name file (car dirs)))))
+       (setq dirs (cdr dirs)))
+      found)))
+
 (defun finder-commentary (file)
   (interactive)
-  (let* ((str (lm-commentary file)))
+  (let* ((str (lm-commentary (finder-find-library file))))
     (if (null str)
        (error "Can't find any Commentary section."))
     (pop-to-buffer "*Finder*")